<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <div id="app">
      <div ref="oDiv">{{ count }}</div>
      <button @click="add">加1</button>
    </div>
  </body>
  <script src="../lib/vue.global.js"></script>
  <script>
    Vue.createApp({
      data() {
        return {
          count: 10,
        };
      },
      methods: {
        add() {
          this.count++;
          console.log("1", this).count;
          console.log("2", this.$refs.oDiv.innerHTML);

          this.$nextTick(() => {
            console.log("3", this.$refs.oDiv.innerHTML);
          });
        },
      },
    }).mount("#app");
  </script>
</html>
